#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import client_utils
from client_utils import ad_logging as log
import time

LOCAL_PATH = os.getcwd()

ROOT_URL = 'http://i.spilot.com.cn/medias/update/'


def check_update():
    '''
    1. dl update.ini
    2. read update.ini
    3. check each file in update.ini
        1. if file not exitst . dl it
        2. if file hash not match . dl it
        3. if file exist but not in update.ini . delete it
    '''
    pass

def main():
    log.info('start..........')
    check_update()
    client_utils.get_file('http://i.spilot.com.cn/medias/update/update.ini',f_save_to_dir='C:/abc', f_name='a.ini')
    log.info('sleep...')
    time.sleep(60)
    
if __name__ == '__main__':
    # OK set current process priority to low
    client_utils.set_current_process_priority()
    
    main()
    
    